<template>
	<view>
		<u-navbar title="提现" placeholder autoBack>
			<view class="flexright xiaohui" slot="right" @click="bangdingzh">绑定账户</view>
		</u-navbar>
		<view class="toubutx mainpadding" style="padding-bottom: 80rpx;">
			<view class="xiaobtext">可提现金额（元）</view>
			<view class="margin_top2 flexleft">
				<view class="colour">￥</view>
				<view class="dbaitext">23883289.00</view>
			</view>
		</view>
		<view class="mainpadding">
			<view class="neirong">
				<view class="mainpadding ffffff radius ">
					<view class="notitletext">提现金额 (元)</view>
					<view class="flexbetween margin_top">
						<view class="" style="flex: 5;">
							<input type="number" class="daheitext" v-model="txprice">
						</view>
						<view class="huangsetext" style="flex: 1.1;"@click="alltx">全部提现
						</view>
					</view>
				</view>
				<view class="mainpadding_top ffffff radius">
					<view class="flexbetween">
						<view class="main_size hei_text bold">选择银行卡</view>
						<view class="huang_text main_size">添加</view>
					</view>
					<view :class="index==2?'':'pdl'" v-for="(item,index) in 3" class="flexbetween margin_top">
						<view class="xiaohui">农业银行（8293）</view>
						<view class="checkaudio"></view>
						<!-- <view class="nocheckaudio"></view> -->
					</view>
				</view>
				<view class="mainpadding_top ffffff radius">
					<view class="main_size hei_text bold">提现规则</view>
					<view class="xiaohui margin_top">提现规则提现规则提现规则提现规则提现规则提现规则提现规则提现规则</view>
				</view>
				<view class="submitbtn margin_top">提现</view>
				<view class="xiaohuang margin_top flexcenter" @click="tztxjl">提现记录</view>
			</view>
		</view>
		<!-- 提现弹出层 -->
		<!-- <u-popup :show="show" :round="10" mode="center" @close="close">
			<view class="tanchuceng">
				<view class="tixianicon"></view>
				<view class="textcenter notitletext margin_top2">提现申请发起成功，正在处理中！</view>
				<view class="flexcenter">
					<view class="querenbtn margin_top" @click="close">確認</view>
				</view>
			</view>
		</u-popup> -->
		<!--未认证弹框   -->
		<!-- <u-popup :show="wrzshow" @close="wrzclose" mode="center" :round="10">
			<view>
				<view class="mainpadding">
					<view class="textcenter bigtext">温馨提示</view>
					<view class="huisetext textcenter margin_top7">{{rztext}}</view>
				</view>
				<view class="flexbetween margin_top7">
					<view class="quxiaobtn" @click="wrzshow = false">取消</view>
					<view class="renzbtn" @click="tzsmrz" v-if="personInfo.realname_status!=2">立即认证</view>
					<view class="renzbtn" @click="wrzshow = false" v-if="personInfo.realname_status==2">確定</view>
				</view>
			</view>
		</u-popup> -->
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listbz:{},
				show: false,
				wrzshow: false,
				paytype: 1,
				personInfo: {},
				txprice: "",
				//flag: true, //如果提现金额大于可提现金额为false
				rztext: "",
				withdrawal_bz: "", //提现備注  
				realname_status: "", //实名认证状态
			}
		},
		methods: {
			// 绑定账户
			bangdingzh(){
				uni.navigateTo({
					url: '/pages_mine/bindingAccount'
				})
			},
			beizhu(){//提现備注
				let _this=this
				httpRequest.request('/api/index/getConfigInfo','GET').then(res=>{
					this.listbz=res.data
				})
			},
			getinfo() {//用户信息
				httpRequest.request('/api/user/index', 'GET', {}, false, false, true).then(res => {
					if (res.code == 1) {
						this.personInfo = res.data
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			// 跳转实名认证
			tzsmrz() {
				this.wrzshow = false
				uni.navigateTo({
					url: '/pages/mypage/shimingrz'
				})
			},
			// 跳转提现记录
			tztxjl() {
				// if (this.personInfo.realname_status == 1) {
				// 	this.rztext = "未实名认证无法进行操作！"
				// 	this.wrzshow = true
				// 	return false
				// } else if (this.personInfo.realname_status == 2) {
				// 	this.rztext = "您的实名认证处于待审核状态，暂时无法进行此类操作"
				// 	this.wrzshow = true
				// 	return false
				// } else if (this.personInfo.realname_status == 4) {
				// 	this.rztext = "您的实名认证验证失败，请重新认证"
				// 	this.wrzshow = true
				// 	return false
				// }
				uni.navigateTo({
					url: '/pages_mine/withdrawRecords'
				})
			},
			tixianbtn() {
				/* this.show = true */
				let _this = this;
				if (this.personInfo.realname_status == 1) {
					this.rztext = "未实名认证无法进行操作！"
					this.wrzshow = true
					return false
				} else if (this.personInfo.realname_status == 2) {
					this.rztext = "您的实名认证处于待审核状态，暂时无法进行此类操作"
					this.wrzshow = true
					return false
				} else if (this.personInfo.realname_status == 4) {
					this.rztext = "您的实名认证验证失败，请重新认证"
					this.wrzshow = true
					return false
				}
				if (this.txprice == "") {
					httpRequest.toast("请输入提现金额")
					return false
				}
				httpRequest.request('/api/user/addWithdrawal', 'GET', {
					price: _this.txprice,
				}, false, false, true).then(res => {
					if (res.code == 1) {
						this.show = true
					} else {
						httpRequest.toast(res.msg);
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			close() { //提现弹出框
				this.show = false
			},
			wrzclose() {// 未认证弹框 
				this.wrzshow = false
			},
			alltx(){//全部提现
				this.txprice = this.personInfo.money;
			},
		}
	}

</script>

<style lang="scss" scoped>
	.bighuangsetext {
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFB800;
	}
	
	.toubutx{
		background-color: #FFB800;
	}
	.colour {
		color: #fff;
	}

	.renzbtn {
		width: 291.5rpx;
		height: 74rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #fff;
		border-top: 1rpx solid #E7E7E7;
		// border-right:1rpx solid #E7E7E7;
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		border-radius: 0 0 20rpx 0;
		color: #228DFF;
	}
/deep/.u-radio-group {
		flex: none !important;
	}
	.quxiaobtn {
		border-radius: 0 0 0 20rpx;
		width: 291.5rpx;
		height: 74rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #fff;
		border-top: 1rpx solid #E7E7E7;
		border-right: 1rpx solid #E7E7E7;
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #666666;
	}

	.tanchuceng {
		padding: 40rpx 70rpx;
	}


	.querenbtn {
		border-radius: 40rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		width: 328rpx;
		height: 64rpx;
		background-size: 100% 100%;
		display: flex;
		background-color: #FFB800;
		align-items: center;
		justify-content: center;
	}

	.hongstext {
		font-size: 26rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FF0303;
	}

	.huisetext {
		font-size: 26rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #666666;
	}


	.xiahuax {
		padding-bottom: 30rpx;
		border-bottom: 2rpx solid rgba(0, 0, 0, 0.05);
	}

	.huangsetext {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFB800;
	}

	.sishitext {
		font-size: 40rpx;
		font-family: DIN Next LT Pro-Regular, DIN Next LT Pro;
		font-weight: 400;
		color: #333333;
	}

	.daheitext {
		font-size: 55rpx;
		font-family: DIN Next LT Pro-Regular, DIN Next LT Pro;
		font-weight: 500;
		color: #333333;
	}

	.neirong {
		position: relative;
		top: -80rpx;
	}

	.dbaitext {
		font-size: 40rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #FFFFFF;
	}

	.xiaobtext {
		font-size: 24rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #FFFFFF;
	}

	.margin_top7 {
		margin-top: 70rpx;
	}

</style>

